[Monitor + Interp] Wishbone subordinate example#193
Merged
Conversation
…nfo' into wishbone_example
Contributor
Author
|
Some possible next steps for expanding the Wishbone case-study further:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a test case containing a Wishbone subordinate. The Makefile, C++ testbench and Verilog files (in the interpreter's test for this example) are taken from:
(with minor modifications so that Verilator works on M-series Macs)
The VCD file is produced by their test-bench.
The monitor infers the following trace from the VCD:
This mostly matches the
.txfile supplied to the interpreter (the only difference is that the two writes in the.txfile arewrite(0, 1)instead ofwrite(0, 0)). There are some differences between the interpreter and their test-bench which I've been unable to figure out, so we should exclude this example from the round-trip tests.Side-note about
stallandackNote: in the
writeprotocol, we only wait tillackbecomes 1, like so:We don't need to wait for
stallto become 0 in a separate while-loop, because the spec for Wishbone B4 Pipeline mode allows forackandstallto change at the same time. In this particular Verilog DUT,stallandackare both 1 in the same cycle (theack = 1means the current request has been serviced, whereasstall = 1indicates that the next request has to wait).If instead we had written the following, this would be wrong:
The reason why this is wrong is that since
stallandackcan be updated at the same time, if we waited for them sequentially (one after another), we would miss aack = 1that could have arrived when we still hadstall = 1.Thus, in the
writeprotocol in this PR, we only wait forackto become 1.